package haven.javafx.module.base;

import javafx.stage.Modality;

public abstract class View<T extends BaseController,V extends View> {
    public T controller;
    public V parentView;

    public View(){
       controller= setController();
        parentView= setParentView();
        controller.setScene();
        initcontroller();
    }
    public abstract T setController();
    public abstract V setParentView();
    public void initcontroller(){
        if(parentView==null){
            controller.initModality(Modality.NONE);
        }else{
            controller.initOwner(parentView.controller);
            controller.initModality(Modality.WINDOW_MODAL);
        }
    }
}
